package com.doit.day03;

import java.util.Iterator;

public class TestIter {
    public static void main(String[] args) throws Exception {
        HeroIterator heroIterator = new HeroIterator();
        while (heroIterator.hasNext()){
            System.out.println(heroIterator.next());
        }


        IterableDemo heroes = new IterableDemo();
        Iterator<Hero> iterator = heroes.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }

    }
}
